function player(x,y)
{
	this.x = x;
	this.y = y;
	this.dx = 0;
	
	this.acc = false;
	
	
	this.draw = function(){

	if(this.dir==1)
	ctx.drawImage(player_img_array[1], this.x,this.y,150,110);
	if(this.dir==-1)
	ctx.drawImage(player_img_array[2], this.x,this.y,150,110);
	
	if(this.dx<3)
    ctx.drawImage(player_img_array[0], this.x,this.y,150,110);
	}
	
	
	
	this.move = function(){
	
	if(this.acc)
	{
		if(this.dx<10) this.dx+=2;
	}
	else
	{
		if(this.dx>0) this.dx-=2;
	}
	
	if((this.x > 100) && (this.dir == -1) ||(this.x < 550) && (this.dir == 1))
	this.x += this.dx * this.dir;
	}
	
}